package com.ruoyi.zhhq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zhhq.mapper.CarorderMapper;
import com.ruoyi.zhhq.domain.Carorder;
import com.ruoyi.zhhq.service.ICarorderService;

/**
 * 车辆订单Service业务层处理
 * 
 * @author Anthony Lu
 * @date 2022-10-26
 */
@Service
public class CarorderServiceImpl implements ICarorderService 
{
    @Autowired
    private CarorderMapper carorderMapper;

    /**
     * 查询车辆订单
     * 
     * @param orderId 车辆订单主键
     * @return 车辆订单
     */
    @Override
    public Carorder selectCarorderByOrderId(String orderId)
    {
        return carorderMapper.selectCarorderByOrderId(orderId);
    }

    /**
     * 查询车辆订单列表
     * 
     * @param carorder 车辆订单
     * @return 车辆订单
     */
    @Override
    public List<Carorder> selectCarorderList(Carorder carorder)
    {
        return carorderMapper.selectCarorderList(carorder);
    }

    /**
     * 新增车辆订单
     * 
     * @param carorder 车辆订单
     * @return 结果
     */
    @Override
    public int insertCarorder(Carorder carorder)
    {
        carorder.setCreateTime(DateUtils.getNowDate());
        return carorderMapper.insertCarorder(carorder);
    }

    /**
     * 修改车辆订单
     * 
     * @param carorder 车辆订单
     * @return 结果
     */
    @Override
    public int updateCarorder(Carorder carorder)
    {
        carorder.setUpdateTime(DateUtils.getNowDate());
        return carorderMapper.updateCarorder(carorder);
    }

    /**
     * 批量删除车辆订单
     * 
     * @param orderIds 需要删除的车辆订单主键
     * @return 结果
     */
    @Override
    public int deleteCarorderByOrderIds(String[] orderIds)
    {
        return carorderMapper.deleteCarorderByOrderIds(orderIds);
    }

    /**
     * 删除车辆订单信息
     * 
     * @param orderId 车辆订单主键
     * @return 结果
     */
    @Override
    public int deleteCarorderByOrderId(String orderId)
    {
        return carorderMapper.deleteCarorderByOrderId(orderId);
    }
}
